<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue过度</title>
    <script src="../js/vue.js"></script>
    <style>
        .fade-enter-active, .fade-leave-active{
            transition: opacity .5s;
        }
        .fade-enter, .fade-leave-active{
            opacity:0
        }
    </style>
</head>
<body>
<div id="demo">
    <button @click="show=!show">
        Toggle
    </button>
    <transition name="fade">
        <p v-if="show">hello</p>
    </transition>
</div>
</body>
<script>
    var vm=new Vue({
        el:'#demo',
        data:{
            show:true
        }
    })
</script>
</html>